<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function fun(){
				var num=document.getElementById("num").value;
				var res=document.getElementById("res");
				var reg=/^(([1-9]\d{0,14})|0)(\.\d{1,2})?$/;
				if(reg.test(num)){
					res.innerHTML="测试通过";
				}else{
					res.innerHTML="测试未通过";
				}
			}
		</script>
	</head>
	<body>
		请输入金额：<input type="text" id="num" />
		<button onclick="fun()">验证</button>
		<div id="res"></div>
	</body>
</html>
